#include <bits/stdc++.h>
#include "CAN.h"

using namespace std;

/*
 * sudo ip link set can0 type can bitrate 500000
 * sudo ip link set up can0
 * sudo ip link set down can0
*/

int main()
{
	CAN *const CAN_Handler = CAN::getInstance();

	// CAN_Handler->SetFilter(10);
	vector<unsigned char> dat;
	vector<unsigned char> RX_Buf;
	int RX_Id = 0;
	for(int i=0;i<26;++i) {
        dat.emplace_back('A' + i);
	}
	
	while(1) {
		CAN_Handler->sendMessage(1, dat);
		// RX_Id = CAN_Handler->getMessage(RX_Buf);
		// if(!RX_Buf.empty()) {
		// 	cout << "Message ID: " << RX_Id << '\t';
		// 	for(int i=0;i<RX_Buf.size();++i) {
		// 		cout << (int)RX_Buf[i] << ' ';
		// 	}
		// 	cout << endl;
		// } else {
		// 	cout << "No CAN Message!" << endl;
		// }
		sleep(5);
	}

	return 0;
}
